package kr.blogspot.stiner01.moduletutorial;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.view.Window;
import android.view.WindowManager;

public class FullScreenTest extends Activity
{
    WakeLock _wakeLock = null;
    
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                             WindowManager.LayoutParams.FLAG_FULLSCREEN);
        
        PowerManager powerManager = (PowerManager)this.getSystemService(Context.POWER_SERVICE);
        _wakeLock = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK, "My Lock");
    }
    
    @Override
    protected void onResume()
    {
        super.onResume();
        
        _wakeLock.acquire();
    }
    
    @Override
    protected void onPause()
    {
        super.onPause();
        
        _wakeLock.release();
    }
}
